# -*- coding: utf-8 -*-
# @Time    : 2021/3/19 8:28
# @Author  : luogan
# @Email   : 468640092@qq.com
# @File    : 2021.3.18运算符与表达式.py
# @Software: PyCharm


#1
20<x<30 or x< -100

#2
y % 2 ==1
#3
if a != b and (a > 0 and b > 0):
    print("a%b+a/b*b==a")

#4
"abc in str1"
#
# #5
# 127>>2
31

#6
t = 3 or print("5") and not print('abc')
print(t)

#7

from decimal import Decimal
a = 5
b = 7
print(1.0+a/b)

#8
import random
RandomLight = random.randint(0,11)
#表示随机选择0或1共12次,并产生12个数字字符列表
Random_count_choices = random.choices("01" , k=12)
Light_condition = "".join(Random_count_choices)
# 0为灭灯状态 1为亮灯状态
if int(Random_count_choices[RandomLight]) == 1:
        print(f"您的亮灯情况为: {Light_condition}")
        print(f"你打到了第{RandomLight+1}个灯.\n游戏结果: True")
else:
        print(f"您的亮灯情况为: {Light_condition}")
        print(f"你打到了第{RandomLight+1}个灯.\n游戏结果: False")

